package com.simple.common.enumdto;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @ClassName FundEnum
 * @Author SimpleTree
 **/
@Getter
@AllArgsConstructor
public enum FundEnum {
    zsbj(1, "招商白酒", "川"),
    gfjy(2, "广发集优", "川"),
    zsxf(3, "招商鑫福", "川"),
    thzq(4, "天弘增强", "川"),
    yhay(5, "银华安颐", "川"),
    fggy(6, "富国国有", "川"),
    yfdw(7, "易方达稳丰", "川"),
    nfwy(8, "南方旺元", "川"),
    gsgy(9, "国寿广源", "川"),
    gfjr(10, "广发聚荣", "川"),

    ;
    private Integer code;
    private String fundName;
    private String username;

    public static String getFundName(Integer code) {
        return Arrays.stream(FundEnum.values()).filter(value -> code.equals(value.getCode())).findFirst().map(FundEnum::getFundName).orElse("");
    }
}
